import axios from 'axios';
import Vue from 'vue'
import Vuex from 'vuex';
Vue.use(Vuex);
let store = new Vuex.Store({
  state:{
    list:[]
  },
  mutations:{
    fn_getData(state,payload){
      state.list = payload;
    }
  },
  actions:{
    async fn_setData({commit}){
      let {data} = await axios.get('https://mock.presstime.cn/mock/61bd885090bfb20016179261/wang/shuai');
      commit('fn_getData',data.list)
    }
  },
})
export default store